package com.atguigu.lease.common.utils;

import java.util.Random;

/**
 * ClassName: CodeUtils
 * Description:
 *
 * @Author hy
 * @Create 8/9/2024 下午8:34
 * @Version 1.0
 */
public class CodeUtils {
    public static String randomCode(int length){
        StringBuilder builder = new StringBuilder();
        Random random = new Random();
        for(int i = 0; i < length;i++){
            int n = random.nextInt(10);
            builder.append(n);
        }
        return builder.toString();
    }
}
